# -*- coding: utf-8 -*-
from util.constants import Constants
from util.utils import Utils


#####################################
## 商品模块
#####################################

class KangmaProduct():

    def __init__(self, user):
        self.user = user

    # 商品管理-商品列表
    def getProductList(self, args={}):
        url = Constants.SUPPLIER_PRODUCT_LIST
        data = {'deleted': 0,
                'supplierId': args['supplierId'],
                'goodsSn': args['goodsSn'],
                'name': args['name'],
                'mnemonicCode': args['mnemonicCode'],
                'categoryId': args['categoryId'],
                'brandId': args['brandId'],
                'status': args['status'],
                'isMarketable': args['isMarketable'],
                'page': 1,
                'limit': 10}
        r = Utils.post(self.user.contentType,
                       self.user.clientId,
                       self.user.clientSecret,
                       self.user.authorization,
                       url,
                       data)
        return Utils.getReturnData(r)
